<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>定位</title>
	<style type="text/css">
		.con{
			width: 400px;
			height: 400px;
			border: 1px solid #000;
			margin: 100px auto 0;
			position: relative;
		}		
		.con div{
			width: 200px;
			height: 100px;
			margin: 20px;
			background-color: gold;
			text-align: center;
			line-height: 100px;
			font-size: 40px;  
		}
		/*相对定位*/
		body .box01{
			position: relative;
			left: 50px;
			top: 50px;
			background-color: green;
		}
		/*绝对定位*/
		body .box02{
			position: absolute;
			left: 10px;
			top: 10px;
			background-color: red;
		}
	</style>
</head>
<body>
	<div class="con">
		<div class="box01">1</div>
		<div class="box02">2</div>
		<div class="box03">3</div>
	</div>
</body>
</html>